package com.lsj.order.controller;

import com.lsj.order.bean.Order;
import com.lsj.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/create")
    public Order create(@RequestParam("productId") Long productId,@RequestParam("userId") Long userId) {
        return orderService.createOrder(productId,userId);
    }
}
